#ifndef INPUT_MANAGER_H
#define INPUT_MANAGER_H

class MessageSystem;
class InputManager
{
public:
	struct 
	{
		Vec2 m_position;
		Vec2 m_direction;
		Vec2 m_wheel_position;
		int m_wheel_delta;
	} m_mouse;

	InputManager();
	~InputManager();

	bool Init(MessageSystem* message_system);
	void Capture();

	bool KeyDown(EKeyCode key);
	bool KeyPressed(EKeyCode key);
	bool KeyReleased(EKeyCode key);

	bool ButtonDown(EMouseButton button);
	bool ButtonPressed(EMouseButton button);
	bool ButtonReleased(EMouseButton button);

protected:
	MessageSystem* m_message_system;

	//Keyboard
	bool m_curr_keys[99];
	bool m_prev_keys[99];

	//Mouse buttons
	bool m_curr_buttons[5];
	bool m_prev_buttons[5];

	void OnKeyboard(IEvent *event);
	void OnMouseMove(IEvent *event);
	void OnMouseButton(IEvent *event);
	void OnMouseWheel(IEvent *event);
};

#endif //INPUT_MANAGER_H